package com.example.demo.order.feign;

import com.example.demo.product.ProductDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 使用fallback做降级处理时
// 1. 必须引入sentinel依赖   2.必须开启sentinel降级开关 feign.sentinel.enable = true
@FeignClient(value = "product-service", fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {

    @GetMapping("/product/{pid}")
    ProductDto getProduct(@PathVariable("pid") String productId);

}
